package com.cjl.service.impl;

import com.cjl.entity.EbProductCategory;
import com.cjl.mapper.ProductCategoryMapper;
import com.cjl.service.ProductCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ProductCategoryServiceImpl implements ProductCategoryService {
    @Autowired
    private ProductCategoryMapper productCategoryMapper;

    @Override
    public List<EbProductCategory> listByPage(Integer page, Integer pageSize) {
        System.out.println("调用了Service的ListByPage方法");
        int from = (page-1)*pageSize;
        return productCategoryMapper.findByPage(from,pageSize);
    }

    @Override
    public Integer findTotalPage(Integer pageSize) {
        return productCategoryMapper.getTotalPage(pageSize);
    }

    @Override
    public Integer save(EbProductCategory ebProductCategory) {
        return productCategoryMapper.save(ebProductCategory);
    }

    @Override
    public EbProductCategory selectOne(Integer epcId) {
        return productCategoryMapper.selectOne(epcId);
    }

    @Override
    public Integer updateProductCategory(EbProductCategory ebProductCategory) {
        return productCategoryMapper.updateByPrimaryKey(ebProductCategory);
    }

    @Override
    public int delete(Integer id) {
        return productCategoryMapper.delete(id);
    }

}


